package com.cyzy.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cyzy.mapper.BannerMapper;
import com.cyzy.pojo.Banner;
import com.cyzy.pojo.Product;
import com.cyzy.service.BannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BannerServiceImpl extends ServiceImpl<BannerMapper, Banner> implements BannerService {
    @Autowired
    BannerMapper bannerMapper;

    public List<Banner> getBannerList() {
        QueryWrapper<Banner> wrapper = Wrappers.query();
        String type="商城";
        List<Banner> list = bannerMapper.selectList(wrapper.eq("banner_type",type).eq("product_id",-1));
        return list;
    }
}
